# *-*- coding:utf-8 -*-
# @Author  : Eliza
# @Time    : 2021/7/18 0:25
# @Software : RubyMine

~~~22
~12

class Game
  def initialize(id, title, price)
    @id = id
    @title = title
    @price = price
  end

  def showGame
    puts @id.to_s + "," + @title + "," + @price.to_s
  end

  def self.toStr
    puts "I love this game ."
  end
end

# 类/模块名称必须以大写字母开头
class SteamGame < Game
  def initialize(id, title, price)
    super
  end

  def Steaminfol
    puts "G胖说了, STEAM要统一各个平台，完成Game All In One。"
  end
end

puts "----------"
Game.toStr #静态方法
SteamGame.toStr #调用父类静态
puts "----父类------"
g1 = Game.new(1, "HH", 12)
g1.showGame
puts "----子类------"
s1 = SteamGame.new(2, "SS", 22)
s1.Steaminfol
s1.showGame #子用父